package org.hackystat.ui.telemetryviewer.gwt.client;

import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.VerticalPanel;

/**
 * Introduction chart widget which describes some stuff about the project at the first tab.
 *
 * @author Pavel Senin.
 *
 */
public class ChartInfo
    extends ChartWidget {

  /**
   * Creates an instance and reports a handler.
   *
   * @return the widget handler.
   */
  public static ChartHandler init() {
    return new ChartHandler("Info", "General application information") {
      public ChartWidget createInstance() {
        return new ChartInfo();
      }
    };
  }

  /**
   * Instantiates the ChartInfo widget.
   *
   */
  public ChartInfo() {
    VerticalPanel vp = new VerticalPanel();
    vp.setVerticalAlignment(VerticalPanel.ALIGN_TOP);
    vp.setSpacing(0);

    HTML html = new HTML("<p>This is the Mockup01 tabbed sample.  "
        + "It demonstrates the top tab-menu design that was originally suggested. "
        + "</p> <p>This sample also intended to demonstrate something else really "
        + "useful in GWT: history support. (Not really et). When you click on a tab, the location "
        + "bar will be updated with the current <i>history token</i>, which keeps the app "
        + "in a bookmarkable state.  The back and forward buttons work properly " + "as well.</p>",
        true);
    html.setStyleName("chart-InfoWidget");

    vp.add(html);

    initWidget(vp);
  }

}